* Work around git hash-object --stdin-paths's odd stripping of carriage
return from the end of the line (some windows infection), avoiding
crashing when the repo contains a filename ending in a carriage return.
+ * Document that settting preferred content to "" is the same as the
+ default unset behavior.
+ * sync: Avoid misleading warning about future preferred content
+ transition when preferred content is set to "".
-- Joey Hess <id@joeyh.name> Mon, 02 Dec 2024 13:41:31 -0400
import Utility.OptParse
import Utility.Process.Transcript
import Utility.Tuple
+import Utility.Matcher
import Control.Concurrent.MVar
import qualified Data.Map as M
_ -> do
m <- preferredContentMap
hereu <- getUUID
- when (any (`M.member` m) (hereu:map Remote.uuid remotes)) $
+ when (any (preferredcontentconfigured m) (hereu:map Remote.uuid remotes)) $
showwarning
where
showwarning = earlyWarning $
<> " send any content, use --no-content (or -g)"
<> " to prepare for that change."
<> " (Or you can configure annex.synccontent)"
+ preferredcontentconfigured m u =
+ maybe False (not . isEmpty . fst) (M.lookup u m)
notOnlyAnnex :: SyncOptions -> Annex Bool
notOnlyAnnex o = not <$> onlyAnnex o
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2024-12-13T16:52:18Z"
+ content="""
+Ah, you're right that this future change in `git-annex sync` behavior is
+one way that "anything" is different from not configured.
+
+It turns out that you can just use `git-annex wanted here ""` to get back
+the same behavior as the preferred content being unset. I had forgotten
+about that, and it was not really documented anywhere, which I've
+corrected.
+
+Running `git-annex sync` without --content with preferred content set to ""
+currently warns about the transition, but that warning is false. I'm fixing
+it to not warn in this case.
+
+As to the heroic measures, .git/annex/index gets merged into whatever is in
+the git-annex branch, so you need to delete that file as well as rewriting
+the branch. And you need to do this in every single repository that has
+received the unwanted change. And since it also auto-merges git-annex
+branches from remotes, you probably will want to temporarily remove the
+remote tracking branches from git's ref list.
+"""]]
the repository wants to drop its content (if there are enough copies
elsewhere to allow removing it).
+An empty preferred content expression is treated the same as preferred
+content not being configured.
+
# EXPRESSIONS
* `include=glob` / `exclude=glob`